<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current">
        
        <header class="bar bar-nav fs-header-small">
          <a href="${ctx.host}/profile/courses/${courseRound.id}" class="icon icon-left pull-left"></a>
          <h1 class="title">课程记录</h1>
        </header>
        
        <div class="content">
          <div class="schedule-warp">
            <div class="content-padded no-margin">
              <div class="row course-schedule">
                 <c:forEach var="courseSchedule" items="${courseRound.schedules}" varStatus="status">
                   <c:choose>
                     <c:when test="${courseSchedule.scheduleStatus.finish}">
                       <div class="col-33 finished">
                         <a href="${ctx.host}/profile/course-schedules/${courseSchedule.id}">
                           <fmt:formatDate value="${courseSchedule.occurDate}" pattern="MM月dd日"/><br>
                           <fmt:formatDate value="${courseSchedule.occurDate}" pattern="E "/>${courseSchedule.occurHour}<br>
                           <span style="color: #777; line-height: 1.2rem">查看寄语</span>
                         </a>
                         <span class="number">${status.index + 1}</span>
                       </div>
                     </c:when>
                     <c:when test="${courseSchedule.scheduleStatus.ready}">
                       <div class="col-33 waiting">
                         <a href="${ctx.host}/profile/course-schedules/${courseSchedule.id}">
                           <fmt:formatDate value="${courseSchedule.occurDate}" pattern="MM月dd日"/><br>
                           <fmt:formatDate value="${courseSchedule.occurDate}" pattern="E "/>${courseSchedule.occurHour}
                        </a>
                        <span class="number">${status.index + 1}</span>
                       </div>
                     </c:when>
                     <c:when test="${courseSchedule.scheduleStatus.expiry}">
                       <div class="col-33 expiry">
                         <a href="${ctx.host}/profile/course-schedules/${courseSchedule.id}">
                           <fmt:formatDate value="${courseSchedule.occurDate}" pattern="MM月dd日"/><br>
                           <fmt:formatDate value="${courseSchedule.occurDate}" pattern="E "/>${courseSchedule.occurHour}<br>
                           <span style="color: #777; line-height: 1.2rem">课程逾期</span>
                        </a>
                        <span class="number">${status.index + 1}</span>
                       </div>
                     </c:when>
                     <c:when test="${courseSchedule.scheduleStatus.schedule}">
                       <div class="col-33 undo">
                         <a href="#" style="text-align: left;">
                            待预约
                         </a>
                         <span class="number">${status.index + 1}</span>
                       </div>
                     </c:when>
                     
                   </c:choose>
                 </c:forEach>
              </div>
            </div>
          </div>
        </div>
        <!-- End Content -->
        
      </div>
    </div>
    
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/course/course-detail.js" />
    <script type="text/javascript">
      require(['page/course/course-detail'], function(page) {
        page.init()
      })
    </script>
    
  </body>
</html>